﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;

namespace OgrIsleri.DashBoard.Ajax
{
    public partial class Ajax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string Islem = Request.QueryString["Islem"];
            switch (Islem)
            {
                case "MesajSayisi": OkunmamisMesajSayisi(); break;
            }
        }
        private void OkunmamisMesajSayisi()
        {
            using (DbEntities db = new DbEntities())
            {
                Guid Kullanici = (Guid)Membership.GetUser().ProviderUserKey;
                var data = db.tblMesajlars.Where(o => o.AliciID == Kullanici && o.Okundu == false).ToList();
                Response.Write(data.Count);
            }
        }
    }
}